
package com.ukao.steward.pesenter.logistics;

import com.ukao.steward.base.BasePresenter;
import com.ukao.steward.bean.StringBean;
import com.ukao.steward.consts.Constant;
import com.ukao.steward.consts.SaveParams;
import com.ukao.steward.retrofit.ApiCallback;
import com.ukao.steward.view.logistics.SettingView;

import java.util.HashMap;

/**
 * Created by ukaodev on 2017/6/28.
 */

public class SettingPesenter extends BasePresenter<SettingView> {


    public SettingPesenter(SettingView view) {
        attachView(view);
    }

    /**
     *退出登录
     */
    public void logout() {
       mvpView.showLoading();
        HashMap mHashMap = new HashMap<String, String>();
        mHashMap.put("accessToken", SaveParams.getToken());
        addSubscription(apiStores.logout(Constant.createParameter(mHashMap)),
                new ApiCallback<StringBean>() {
                    @Override
                    public void onSuccess(StringBean model) {

                        if (model.getHttpCode() == 200) {


                        }else{
                              mvpView.showError(model.getMsg());
                        }

                    }

                    @Override
                    public void onFinish() {
                        mvpView.hideLoading();
                    mvpView.logoutSucceed();

                    }
                });
    }








}
